package com.fyzk.activity.prize;

import android.os.Bundle;
import android.widget.ListView;
import android.widget.TextView;

import com.fyzk.base.BaseActivity;
import com.fyzk.activity.user.NetProgressView;
import com.fyzk.utils.DateUtils;
import com.fyzk.utils.IntentParamUtils;
import com.fyzk.view.TopTitleView;
import com.tyjc.lottery.R;

import java.text.SimpleDateFormat;

public abstract class BasePrizeHistoryActivity extends BaseActivity {

	protected TopTitleView topTitleView;
	TextView time;
	ListView listView;
	NetProgressView netProgressView;

	public int lotteryID;

	String currDate;
	String weekTime;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.kaijiang_lishi);
		initView();
		lotteryID = getIntent().getIntExtra(IntentParamUtils.LOTTERYID, 0);
		init();
	}

	private void initView() {
		topTitleView = (TopTitleView)findViewById(R.id.topTitle);
		netProgressView = (NetProgressView)findViewById(R.id.jc_netview);
		topTitleView.setOnTitleClickListener(this);
		time = (TextView) findViewById(R.id.kjls_time);

		currDate = new SimpleDateFormat("yyyy-MM-dd")
				.format(System.currentTimeMillis() - 24 * 60 * 60 * 1000);
		weekTime = DateUtils.dateToWeek(currDate);

		time.setText(currDate + " " + weekTime);
		listView = (ListView) findViewById(R.id.kjls_list);
	}

	protected abstract void init();

	/**
	 * 获取历史开奖信息
	 */
	protected abstract void getInfor(int id);

}